package com.nbufe.controller;

import com.nbufe.domain.ResponseResult;
import com.nbufe.domain.dto.report.GenReportDto;
import com.nbufe.domain.dto.report.PageReportDto;
import com.nbufe.service.ReportsService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @Author luzhiheng
 * @Date 2024/1/5 16:03
 */
@RestController
@RequestMapping("/report")
public class ReportController {

    @Resource
    private ReportsService reportsService;

    @PostMapping("/gen")
    public ResponseResult genReport(@RequestBody GenReportDto dto) {
        return reportsService.genReport(dto);
    }

    @GetMapping("/pageList")
    public ResponseResult pageList(PageReportDto dto) {
        return reportsService.pageListReport(dto);
    }

    @GetMapping("/detail/{id}")
    public ResponseResult detailReport(@PathVariable Long id) {
        return reportsService.detailReport(id);
    }

}
